<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="lib/vue.global.js"></script>
</head>
<body>
    <div id="root"></div>
</body>
<script>
    const {
    createApp,
    onBeforeMount,
    onMounted,
    onBeforeUpdate,
    onUpdated,
    onBeforeUnmount,
    onUnmounted
  } = window.Vue

  const app = createApp({
    setup () {
      console.log('setup')
      // 生命周期的钩子在setup中使用  其是就是针对hooks的使用
      // hooks 的使用：hooks都是函数,参数不一定，此处是回调函数
      onBeforeMount(() => {
        console.log('onBeforeMount')
      })
      onMounted(() => {
        console.log('onMounted')
      })
      onBeforeUpdate(() => {
        console.log('onBeforeUpdate')
      })
      onUpdated(() => {
        console.log('onUpdated')
      })
      onBeforeUnmount(() => {
        console.log('onBeforeUnmount')
      })
      onUnmounted(() => {
        console.log('onUnmounted')
      })

    }
  })
  app.mount('#root')
</script>
</html>